Skip to content

fix: add typesVersions so testing module resolves under classic TypeScript moduleResolution#770

Merged
taeold merged 1 commit into
mainfrom
test-cla-coauthor
Jun 22, 2026
Merged

fix: add typesVersions so testing module resolves under classic TypeScript moduleResolution#770
taeold merged 1 commit into
mainfrom
test-cla-coauthor

Conversation

@taeold

@taeold taeold commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Recreates #764 to resolve the issue with TypeScript module resolution.

Original Description

The exports map in package.json correctly declares the ./testing subpath, but TypeScript's moduleResolution: "node" (the default in most projects) does not read the exports field. This caused getTestServer and getFunction to appear not found when users imported @google-cloud/functions-framework/testing.

Adding typesVersions instructs TypeScript to resolve the testing subpath to ./build/src/testing.d.ts regardless of moduleResolution setting, unblocking users on TypeScript <4.7 or projects that have not yet adopted node16/bundler module resolution.

Fixes #594

Co-authored-by: 64JohnLee 64lamei@gmail.com

@taeold taeold force-pushed the test-cla-coauthor branch from 8b8e57d to dd11c49 Compare June 22, 2026 19:01
…cript moduleResolution

The exports map in package.json correctly declares the ./testing subpath,
but TypeScript's moduleResolution: "node" (the default in most projects) does
not read the exports field. This caused `getTestServer` and `getFunction` to
appear not found when users imported @google-cloud/functions-framework/testing.

Adding typesVersions instructs TypeScript to resolve the testing subpath to
./build/src/testing.d.ts regardless of moduleResolution setting, unblocking
users on TypeScript <4.7 or projects that have not yet adopted node16/bundler
module resolution.

Fixes #594

Co-authored-by: 64JohnLee <64lamei@gmail.com>
@taeold taeold force-pushed the test-cla-coauthor branch from dd11c49 to e32d46c Compare June 22, 2026 19:05
@taeold taeold changed the title test: test CLA bot with co-author fix: add typesVersions so testing module resolves under classic TypeScript moduleResolution Jun 22, 2026
@AnshulPatni AnshulPatni self-assigned this Jun 22, 2026
@AnshulPatni AnshulPatni reopened this Jun 22, 2026
@taeold taeold merged commit d1593c2 into main Jun 22, 2026
71 checks passed
@taeold taeold deleted the test-cla-coauthor branch June 22, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supertest: getTestServer Not Found

2 participants